<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ page import="admin.login.LoginModel" %>
<%@ page import="java.util.List" %>
<jsp:useBean id="login" class="admin.login.LoginDao" scope="page"/>
<%
	String id = request.getParameter("id") == null ? "" : request.getParameter("id");
	String pw = request.getParameter("pw") == null ? "" : request.getParameter("pw");
	boolean loginOk = false;
	if( !id.equals("") && !pw.equals("")){
		List list = login.loginOk(id , pw);
		if(list != null && list.size() >  0){
			loginOk = true;
			LoginModel mod = (LoginModel)list.get(0);
			session.setAttribute("ADMIN_ID",mod.getId());
			session.setAttribute("useyn",mod.getUseyn());
		}
	}
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<script type="text/javascript" src="/admin/js/default.js"></script>
<link href="/admin/css/default.css" rel="stylesheet" type="text/css" />
<script type="text/javascript">
	function loginOk(){
		location.href="/admin/main/main.jsp";
	}

</script>
</head>
<body id="login" <%if(loginOk){ %>onload="javasript:loginOk();" <%} %>>
<!-- Header  Start -->

<!--Contents Start-->
<div class="admin-login">
<h4><img src="/admin/images/share_img/login_ttl.gif" alt="관리자모드"/></h4>
<div class="login-con">
<form action="login.jsp" method="post">
<fieldset>
<div class="login-id">
<p><img src="/admin/images/share_img/login_id.gif" alt="아이디"/></p>
<input name="id" type="text" id="id" title="아이디" value=""  style="width:40%"  />
</div>
<div class="login-pw">
<p><img src="/admin/images/share_img/login_pw.gif" alt="비밀번호"/></p>
<input name="pw" type="password"  id="pw" title="비밀번호" value=""  style="width:40%" />
</div>
<input type="image" src="/admin/images/share_img/btn_login.gif" alt="로그인" class="etc" />
</fieldset>
</form>
<p class="pd-t20">* 로그인이 안될 경우 <span>000-000-0000</span>으로  연락바랍니다.</p>
</div>
</div>
<!--Contents End-->
<!--Footer Start-->
<div id="login-footer">
<img src="/admin/images/share_img/footer.gif" alt="copyright ⓒ HARIM.CO.LTD ALL RIGHTS RESERVED." /></div>
<!--Footer End-->

</body>
</html>